package com.happyclub.pojo;

import javax.persistence.*;
import java.sql.Time;
import java.util.Objects;

@Entity
@Table(name = "TB_TRAVEL", schema = "SCOTT")
@IdClass(TbTravelPK.class)
public class TbTravel {
    private String id;
    private String userId;
    private Time publishTime;
    private String travelContext;
    private Long travelLike;
    private String location;
    private String channel;
    private String ip;
    private Long readNum;
    private Long ok;
    private Time updateTime;
    private Time createTime;
    private String travelTitled;
    private String photoAlbumId;

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Id
    @Column(name = "USER_ID")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "PUBLISH_TIME")
    public Time getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Time publishTime) {
        this.publishTime = publishTime;
    }

    @Basic
    @Column(name = "TRAVEL_CONTEXT")
    public String getTravelContext() {
        return travelContext;
    }

    public void setTravelContext(String travelContext) {
        this.travelContext = travelContext;
    }

    @Basic
    @Column(name = "TRAVEL_LIKE")
    public Long getTravelLike() {
        return travelLike;
    }

    public void setTravelLike(Long travelLike) {
        this.travelLike = travelLike;
    }

    @Basic
    @Column(name = "LOCATION")
    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Basic
    @Column(name = "CHANNEL")
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @Basic
    @Column(name = "IP")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "READ_NUM")
    public Long getReadNum() {
        return readNum;
    }

    public void setReadNum(Long readNum) {
        this.readNum = readNum;
    }

    @Basic
    @Column(name = "OK")
    public Long getOk() {
        return ok;
    }

    public void setOk(Long ok) {
        this.ok = ok;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Time getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Time updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Time getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Time createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "TRAVEL_TITLED")
    public String getTravelTitled() {
        return travelTitled;
    }

    public void setTravelTitled(String travelTitled) {
        this.travelTitled = travelTitled;
    }

    @Basic
    @Column(name = "PHOTO_ALBUM_ID")
    public String getPhotoAlbumId() {
        return photoAlbumId;
    }

    public void setPhotoAlbumId(String photoAlbumId) {
        this.photoAlbumId = photoAlbumId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbTravel tbTravel = (TbTravel) o;
        return Objects.equals(id, tbTravel.id) &&
                Objects.equals(userId, tbTravel.userId) &&
                Objects.equals(publishTime, tbTravel.publishTime) &&
                Objects.equals(travelContext, tbTravel.travelContext) &&
                Objects.equals(travelLike, tbTravel.travelLike) &&
                Objects.equals(location, tbTravel.location) &&
                Objects.equals(channel, tbTravel.channel) &&
                Objects.equals(ip, tbTravel.ip) &&
                Objects.equals(readNum, tbTravel.readNum) &&
                Objects.equals(ok, tbTravel.ok) &&
                Objects.equals(updateTime, tbTravel.updateTime) &&
                Objects.equals(createTime, tbTravel.createTime) &&
                Objects.equals(travelTitled, tbTravel.travelTitled) &&
                Objects.equals(photoAlbumId, tbTravel.photoAlbumId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, publishTime, travelContext, travelLike, location, channel, ip, readNum, ok, updateTime, createTime, travelTitled, photoAlbumId);
    }
}
